<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>利率增长</title>
</head>
<body>
    <script>
        var x=1000,i=0;
        while(x<=2000){
            x+=x*0.05;
            i++;
        }
        alert(i);
        for(n=0,m=1000;m<=2000;n++){
            m+=m*0.05;
        }
        alert(n);
    </script>
</body>
</html>